﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Blog.DAL
{
    public partial class tblwall
    {
        private int __mem_id;
        private int __wall_id;
        private string __action;
        private string __message;
        private int __blog_id;
        private string __day;
        private string __month;
        private string __year;
        private string __hour;
        private string __minute;
        private string __second;
        private int __friend_id;
        public int friends_id { get { return __friend_id; } set { __friend_id = value; } }
        public int memid
        {
            get 
            {
                return __mem_id;
            }
            set
            {
                __mem_id = value;
            }
        }
        public int wall_id
        {
            get
            {
                return __wall_id;
            }
            set
            {
                __wall_id = value;
            }
        }
        public string actions
        {
            get {
                return __action;
            }
            set
            {
                __action = value;
            }
        }
        public string messages
        {
            get
            {
                return __message;
            }
            set
            {
                __message = value;
            }
        }
        public string days
        {
            get
            {
                return __day;
            }
            set
            {
                __day = value;
            }
        }
        public string months
        {
            get
            {
                return __month;
            }
            set
            {
                __month = value;
            }
        }
        public string years
        {
            get
            {
                return __year;
            }
            set
            {
                __year = value;
            }
        }
        public string hours
        {
            get
            {
                return __hour;
            }
            set
            {
                __hour = value;
            }
        }

        public string minutes
        {
            get
            {
                return __minute;
            }
            set
            {
                __minute = value;
            }
        }
        public string seconds
        {
            get
            {
                return __second;
            }
            set
            {
                __second = value;
            }
        }
        public int blogid
        {
            get { return __blog_id; }
            set { __blog_id = value; }
        }

        
        public int add_wall()
        {
            DB db = new DB();
            return db.sp_add_wall(memid,friends_id, action, messages, blogid);
        }

        public int delete_wall()
        {
            DB db = new DB();
            return db.sp_delete_wall(wall_id);
        }
        public List<sp_get_wall_by_idResult> get_wall()
        {
            DB db = new DB();
            return db.sp_get_wall_by_id(memid).ToList();
        }
        public void Save()
        {
            DB db = new DB();
            db.SubmitChanges();
        }
    }
}
